﻿using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.JSON;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;

namespace WSDZ.KM.ZH.PurchaseOrderCollectEntry2
{
    [Description("保存后刷新界面"), HotUpdate]
    public class PurchaseOrderAfterSaveRefresh:AbstractDynamicFormPlugIn
    {
        bool isOk = false;
        public override void AfterDoOperation(AfterDoOperationEventArgs e)
        {
            base.AfterDoOperation(e);
            if (e.ExecuteResult&& e.Operation.Operation.ToStringV1().EqualsV1("Save"))
            {
                if (e.OperationResult.IsSuccess)
                {
                    isOk = true;
                }
            }
        }
        public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
        {
            base.AfterBarItemClick(e);
            if (e.BarItemKey.EqualsV1("tbSave")||e.BarItemKey.EqualsV1("tbSplitSave"))
            {
                if (isOk)
                {
                    isOk = false;
                    this.View.Refresh();
                }
                
            }
        }
    }
}
